const express = require('express');
const app = express();
const path = require('path');
const fs = require('fs');
const mysql = require('mysql');
app.listen(3000, () => { console.log('服务器已开启') });

//渲染页面
app.get('/', (req, res) => {
    res.sendFile(path.join(__dirname, '4.post.html'))
})

//Post接惨
app.use(express.urlencoded({ extended: false }));
app.use(express.json());

//post响应
app.post('/index', (req, res) => {
    res.send({ code: 200, msg: 'ok', cur: req.body })
})